//
//  UserCenterView.m
//  HYApp
//
//  Created by Jianbo Cai on 2020/8/14.
//  Copyright © 2020 Unidax. All rights reserved.
//

#import "UserCenterView.h"

@implementation UserCenterView

-(void)awakeFromNib{
    [super awakeFromNib];
    
    self.custodianLable.text = JFMainLocalizedString(@"custodian");
    self.historyLable.text = JFMainLocalizedString(@"transactions.Title");
    self.creditLable.text = JFMainLocalizedString(@"credit.title");
    self.profileLable.text = JFMainLocalizedString(@"profile.title");
    self.logoutLable.text = JFMainLocalizedString(@"logout");
    self.languageLable.text = JFMainLocalizedString(@"myProfile.language");
    
    self.loginOutView.AWaddTapGestureRecognizer(self, @selector(loginOut));
    
    self.version.text = [NSString stringWithFormat:@"V%@",[JFDeviceInfo appVersion]];
}


- (IBAction)removeAction:(id)sender {
    [self removeFromSuperview];
}

- (IBAction)custodianAction:(id)sender {
    [self clickFunctionCode:0];
}

- (IBAction)historyAction:(id)sender {
    [self clickFunctionCode:1];
}

- (IBAction)creditAction:(id)sender {
//    [self clickFunctionCode:2];
}

- (IBAction)profileAction:(id)sender {
    [self clickFunctionCode:3];
}

- (IBAction)languageAction:(id)sender {
    [self clickFunctionCode:4];
}
-(void)loginOut{
    [self clickFunctionCode:5];
}
- (void)clickFunctionCode:(NSInteger)code {
    if (self.functionAction) {
        self.functionAction(code);
    }
    [self removeFromSuperview];
}

@end
